package com.hellobike.haxing.modules.order.job;

import com.hellobike.haxing.common.constant.CacheConstant;
import com.hellobike.haxing.modules.order.service.IOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * 订单取消审核定时超时关闭
 */
@Slf4j
@Component
public class OrderCancelTimeOutJob {
    @Autowired
    private IOrderService orderService;

    @Scheduled(cron = "0 5 22 * * ? ")
    public void execute(){
        try {
            log.info("==取消订单到结单时间，未审核，默认都审核不通过定时任务开始执行==");
            orderService.updateCancelTimeOutCloseOrder();
        } catch (Exception e) {
            log.error("取消订单审核超时关闭定时任务异常", e);
        }
    }
}
